<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta content="always" name="referrer">
<meta charset="utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!-- 移动端必须的设置 -->
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<!-- 禁用电话号码检测功能，禁止对数字随便可以拨号 -->
<meta name="format-detection" content="telephone=no">
<!-- 禁用E-mail检测功能 -->
<meta name="format-detection" content="email=no">
<!-- 禁用地址检测功能，禁止跳转到地图 -->
<meta name="format-detection" content="address=no">
<!-- 在苹果设备上以全屏方式打开本网页 -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- 设置在苹果设备上状态的颜色，默认白色，要设置成什么颜色以Web颜色的风格而定 -->
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<title>途狗收油</title>
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/base64.js"></script>
<script type="text/javascript" src="../js/layui/layui.js "></script>
<script type="text/javascript" src="../js/recycle/addresslist.js?v=1.3"></script>
<script type="text/javascript" src="../js/recycle/establish.js?v=1.3"></script>
<script type="text/javascript" src="../vendor/resize.js"></script>
<script type="text/javascript" src="../js/jquery.citys.js"></script>
<!-- <script type="text/javascript"
	src="http://api.map.baidu.com/api?v=2.0&ak=wqBXfIN3HkpM1AHKWujjCdsi"></script> -->
<link rel="stylesheet" href="../js/layui/css/layui.css" />
<link rel="stylesheet"
	href="../vendor/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="../vendor/iconfont/iconfont.css" />
<link rel="stylesheet" href="../css/basestyle.css" />
<link rel="stylesheet" href="../css/address.css" />
<link rel="shortcut icon" href="../public/image/favicon.png">
<style type="text/css">
.tangram-suggestion-main {
	z-index: 50;
}

.citys {
	margin-bottom: 10px;
}

.citys p select {
	height: 30px;
}

.warning {
	color: #c00;
}

.main a {
	margin-right: 8px;
	color: #369;
}

.addressspan {
	display: block;
	padding-bottom: 10px;
}
</style>
</head>
<body>
	<%@ include file="../basejsp.jsp"%>
	<div class="header">
		<div class="header-top">
			<a onClick="javascript :history.go(-1);"><i
				class="fa fa-angle-left"></i></a> <span>收油地址</span>
			  <i
				class="icon iconfont "></i> 
		</div>
	</div>
	<div class="main">
		<ul class="content">
		</ul>
		<div class="bottom">
			<a onclick="addaddresspopup()" style="width: 100%">+添加地址</a>
		</div>
	</div>

	<div id="popupwindows" class="popupwindows">
		<div style="margin: 10px auto; width: 98%; height: 96%">
			<span class="addressspan">地址:</span>
			<div id="demo3" class="citys">
				<p>
					<select name="province"></select> 
					<select name="city"></select> 
					<select name="area"></select> 
					<select name="town"></select>
				</p>
			</div>
			<span class="addressspan">详细地址:</span> <input type="text"
				name="title" autocomplete="off" id="baiduaddress"
				class="layui-input" style="height: 30px">
			<div style="margin-top: 15px;">
				<input type="checkbox" title="" id="defaultaddress"><span>是否设为默认地址</span>
			</div>

			<button class="layui-btn layui-btn-normal"
				style="width: 100%; margin-top: 39px;"
				onclick="insertHistoryAddress()">确认提交</button>
		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			
			var $town = $('#demo3 select[name="town"]');
			var townFormat = function(info) {
				$town.hide().empty();
				if (info['code'] % 1e4 && info['code'] < 7e5) { //是否为“区”且不是港澳台地区
					$.ajax({
						url : 'http://passer-by.com/data_location/town/'
								+ info['code'] + '.json',
						dataType : 'json',
						success : function(town) {
							$town.show();
							for (i in town) {
								$town.append('<option value="'+i+'">' + town[i]
										+ '</option>');
							}
						}
					});
				}
			};
			$('#demo3').citys({
				province : '重庆',
				/*city:'厦门',
				area:'思明',*/
				onChange : function(info) {
					townFormat(info);
				}
			}, function(api) {
				var info = api.getInfo();
				townFormat(info);
			});
		})
	</script>
</body>
</html>